#include <vector>
using namespace std;
class Solution {
public:
    vector<int> FindNumbersWithSum(vector<int> array,int x) 
    {
    	vector<int> output;
		if(array.empty())
			return output;
		int head = 0 ,tail = array.size()-1;
		int sum = array[head] + array[tail];
		while(head < tail && sum != x)
		{
			if(sum > x)
				--tail;
			else
				++head;
			sum = array[head] +array[tail];
		}
		if(head != tail)
		{
			output.push_back(array[head]);
			output.push_back(array[tail]);
		}
		return output;
	}

};